package com.bwie.controller;

import com.bwie.pojo.TbProd;
import com.bwie.service.TbProdService;
import com.bwie.utils.Result;
import com.bwie.vo.ProdPageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/shop/prod")
public class TbProdController {
    @Autowired
    TbProdService tbProdService;

    @PostMapping("/getProdList")
    public Result getProdList(@RequestBody ProdPageVo prodPageVo){
        return tbProdService.getProdList(prodPageVo);
    }
    @PostMapping("/addProd")
    public Result addProd(@RequestBody TbProd tbProd){
        return tbProdService.addProd(tbProd);
    }
    @PostMapping("/deleteProdAll")
    public Result deleteProdAll(@RequestBody List<TbProd> prodList){
        return tbProdService.deleteProdAll(prodList);
    }
}
